import { getProList } from '@/api/api';

export default {
  name: 'physical',
  components: {}, 
  props: [],
  data () {
    return {
      getProList: [],
        typearr:['PP','PE','PVC','ABS','PS','AS','PA','PC','茂金属','EAA','塑料制品'],
        purposearr:['汽车部件','薄膜','电子电器部件','电线电缆料','运动器材','其他'],
        jiagongarr:['注塑级','挤出级','注塑级成型','其他'],
      texingarr: ['阻燃', '热稳定', '易弯曲','阻燃', '热稳定', '易弯曲', '耐热', '增韧', '耐磨', '低翘曲', '耐刮增', '耐刮增' , '耐刮增', '啊手动', '阀手动', '热稳定', '易弯曲', '耐热', '增韧', '耐磨', '低翘曲', '耐刮增', '啊手动', '阀手动'],
      newarr:[],
      
      data:{
        typearr:'',
        purposearr:'',
        jiagongarr:'',
        texingarr:''
      }
      
    }
  },
  computed: {

  }, created() {
    this._getProList();
    this.newarr = this.texingarr.slice(0,5)
  },
  mounted () {

  },
  methods: {
    // 调取数据
    _getProList() {
      getProList({}).then(res => {
        this.getProList = res.data;
      })
    },
    addtag(type,item){
      if(type == 1){
        this.data.typearr = item
      } else if (type == 2){
        this.data.purposearr = item
      } else if (type == 3) {
        this.data.jiagongarr = item
      }else{
        this.data.texingarr = item
      }
    }
    // 显示更多
    , showmore(){
      this.newarr = this.texingarr
    }
    , hidemore(){
      this.newarr = this.texingarr.slice(0,5)
    }
    ,remove(type){
      if (type == 1) {
        this.data.typearr = ''
      } else if (type == 2) {
        this.data.purposearr = ''
      } else if (type == 3) {
        this.data.jiagongarr = ''
      } else {
        this.data.texingarr = ''
      }
    }
  }
}
